package com.zhuzhu.util;

import java.io.IOException;

import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.HttpClientBuilder;

public class HttpGetter {

	public String get(String link) throws ClientProtocolException, IOException{
		HttpGet httpGet = new HttpGet(link);
		HttpClient httpClient = HttpClientBuilder.create().build();
		ResponseHandler<String> responseHandler = new BasicResponseHandler();
		return httpClient.execute(httpGet, responseHandler);
	}
}
